---
page_title: "cloudflare_static_route Resource - Cloudflare"
subcategory: ""
description: |-
  Provides a resource, that manages Cloudflare static routes for Magic
  Transit or Magic WAN. Static routes are used to route traffic
  through GRE tunnels.
---

# cloudflare_static_route (Resource)

Provides a resource, that manages Cloudflare static routes for Magic
Transit or Magic WAN. Static routes are used to route traffic
through GRE tunnels.

## Example Usage

```terraform
resource "cloudflare_static_route" "example" {
  account_id  = "f037e56e89293a057740de681ac9abbe"
  description = "New route for new prefix 192.0.2.0/24"
  prefix      = "192.0.2.0/24"
  nexthop     = "10.0.0.0"
  priority    = 100
  weight      = 10
  colo_names = [
    "den01"
  ]
  colo_regions = [
    "APAC"
  ]
}
```
<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `nexthop` (String) The nexthop IP address where traffic will be routed to.
- `prefix` (String) Your network prefix using CIDR notation.
- `priority` (Number) The priority for the static route.

### Optional

- `account_id` (String) The account identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
- `colo_names` (List of String) List of Cloudflare colocation regions for this static route.
- `colo_regions` (List of String) List of Cloudflare colocation names for this static route.
- `description` (String) Description of the static route.
- `weight` (Number) The optional weight for ECMP routes. **Modifying this attribute will force creation of a new resource.**

### Read-Only

- `id` (String) The ID of this resource.

## Import

Import is supported using the following syntax:

```shell
$ terraform import cloudflare_static_route.example <account_id>/<static_route_id>
```
